/**
 * 时间戳转时间字符串
 * @param {number} timestamp - 毫秒时间戳
 * @param {Object} [options] - 格式化选项
 * @param {string} [options.format='zh-CN'] - 语言环境
 * @param {Object} [options.dateTimeOptions] - 日期格式配置
 * @returns {string} 格式化后的时间
 */
export const formatTimestamp = (timestamp, options = {}) => {
    if (!timestamp || typeof timestamp !== 'number') return ''
    
    const defaultOptions = {
      format: 'zh-CN',
      dateTimeOptions: {
        year: 'numeric',
        month: '2-digit',
        day: '2-digit',
        hour: '2-digit',
        minute: '2-digit',
        second: '2-digit'
      }
    }
   
    return new Date(timestamp).toLocaleString(
      options.format || defaultOptions.format,
      { ...defaultOptions.dateTimeOptions, ...options.dateTimeOptions }
    )
  }